import React, { Component } from 'react';
import { Modal, Form, Input,Select,DatePicker,Popconfirm ,Row,Col,Button,Icon,Upload, message} from 'antd';
import styles from '../item.less';
import moment from 'moment'
const FormItem = Form.Item;
const dateFormat = 'YYYY-MM-DD';

const Option = Select.Option;
const Search = Input.Search;


function handleChange(value) {
  console.log(`selected ${value}`);
}

class _Filter extends Component {
    constructor(props) {
      super(props);

      this.state = {

      };
    }
    handleChange(key,value){
        console.log('filter changed',{key,value})
        let fd = Object.assign({},this.props.filter)
        fd[key]= value ==''?null : value
        this.props.filterCallback(fd)
    }
    render() {
        return (<div>
            名称：
              <Select defaultValue="全部" style={{ width: 120 }} onChange={v=>this.handleChange('name',v)}>
                {['全部','桌子','凳子','挂灯','高档沙发',].map(v=><Option key={v} value={v}>{v}</Option>)}
              </Select>
            型号：
            <Select defaultValue="全部" style={{ width: 120 }} onChange={v=>this.handleChange('model',v)}>
              {['全部','ALF','AMBELLA','ASTOLFI 1963','BERNHARDT','CAROTI'
                ,'CEPPI','DAYTONA','DEVINA','FANFANI','FEJOMI','GIMO','GRILLI'
                ,'IDP','JANS2EN','JESSE','LONGHI','MARINER','PIANCA','PREGNO'
                ,'RUGIANO','SIGNORINI&COCO','VANGUARD','VOLPI'].map(v=><Option key={v} value={v}>{v}</Option>)}
            </Select>
            <Search
              placeholder="input search text"
              style={{ width: 200 }}
              onSearch={v => this.handleChange('query',v)}
            />
        </div>)
    }
}

export default Form.create()(_Filter);
